from django.conf.urls import url
from blogapi import views


urlpatterns = [
    url(regex=r'now$',
        view=views.GetNow.as_view(),
        name=views.GetNow.name),
    url(regex=r'^tags/$',
        view=views.TagsListCreate.as_view(),
        name=views.TagsListCreate.name),
    url(regex=r'^tags/(?P<pk>\d+)/$',
        view=views.TagsRetrieveUpdateDelete.as_view(),
        name=views.TagsRetrieveUpdateDelete.name),
    url(regex=r'^categories/$',
        view=views.CategoriesListCreate.as_view(),
        name=views.CategoriesListCreate.name),
    url(regex=r'^categories/(?P<pk>\d+)/$',
        view=views.CategoriesRetrieveUpdateDelete.as_view(),
        name=views.CategoriesRetrieveUpdateDelete.name),
    url(regex=r'^authors/$',
        view=views.AuthorsListCreate.as_view(),
        name=views.AuthorsListCreate.name),
    url(regex=r'^authors/(?P<pk>\d+)/$',
        view=views.AuthorsRetrieveUpdateDelete.as_view(),
        name=views.AuthorsRetrieveUpdateDelete.name),
    url(regex=r'^articals/$',
        view=views.ArticalsListCreate.as_view(),
        name=views.ArticalsListCreate.name),
    url(regex=r'^articals/(?P<pk>\d+)/$',
        view=views.ArticalsRetrieveUpdateDelete.as_view(),
        name=views.ArticalsRetrieveUpdateDelete.name),
    url(regex=r'^artical_tags/$',
        view=views.RArticalTagCreate.as_view(),
        name=views.RArticalTagCreate.name),
    url(regex=r'^artical_tags/(?P<pk>\d+)/$',
        view=views.RArticalTagRetrieveUpdateDelete.as_view(),
        name=views.RArticalTagRetrieveUpdateDelete.name),
    url(regex=r'^artical_authors/$',
        view=views.RArticalAuthorCreate.as_view(),
        name=views.RArticalAuthorCreate.name),
    url(regex=r'^artical_authors/(?P<pk>\d+)/$',
        view=views.RArticalAuthorRetrieveUpdateDelete.as_view(),
        name=views.RArticalAuthorRetrieveUpdateDelete.name),
    url(regex=r'^artical_categories/$',
        view=views.RArticalCategoryCreate.as_view(),
        name=views.RArticalCategoryCreate.name),
    url(regex=r'^artical_categories/(?P<pk>\d+)/$',
        view=views.RArticalCategoryRetrieveUpdateDelete.as_view(),
        name=views.RArticalCategoryRetrieveUpdateDelete.name),
    url(regex=r'^mdsource/(?P<filename>.+\.md)/$',
        view=views.GetMarkdownSource.as_view(),
        name=views.GetMarkdownSource.name),
    url(regex=r'^artical_upload/$',
        view=views.ArticalUpload.as_view(),
        name=views.ArticalUpload.name),
    url(regex=r'^mdlist/$',
        view=views.Mdlist.as_view(),
        name=views.Mdlist.name),
    url(regex=r'^mdlist/(?P<filename>[^/#]+)/$',
        view=views.MdItem.as_view(),
        name=views.MdItem.name),
    url(regex=r'html/$',
        view=views.HTMLList.as_view(),
        name=views.HTMLList.name),
    url(regex=r'html/(?P<filename>[^/]+)/$',
        view=views.HTML.as_view(),
        name=views.HTML.name),
]
